@extends('back.index')
@section('title','课程管理')

@section('style')
    <style>
        .dunk_all{width:600px;marign:0 auto;}
        .form-group{margin-top:20px;}
        .dunk_ps{width:400px;}
        img{width:192px;height:108px;}
        th{text-align:center;}
        td{border-right:1px solid #ccc;}
    </style>
@endsection

@section('mian')
    <div style="font-size:14px;padding:20px;" class="modal-content">
        <h2>
            <input type="submit" class="btn btn-info btn-lg" value="添加专栏" data-toggle="modal" data-target="#myModal">
            <span class="glyphicon glyphicon-hand-left"></span>
            <!-- Modal -->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document" style="z-index:1111;">
                    <div style="font-size:14px;" class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h3 class="modal-title" style="text-align:center;" id="myModalLabel">添加专栏:</h3>
                        </div>
                        <div class="dunk_all">
                            <form  class="form-horizontal" action="{{url('back/center/add_special')}}" method="post" enctype="multipart/form-data">
                            {{csrf_field()}}
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">专栏图片:</label>
                                <div class="col-sm-10">
                                    <input type="file" class="dunk_ps form-control" name="icon">
                                </div>
                            </div>
                            <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">昵称:</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="dunk_ps form-control" placeholder="填写昵称" name="nickname">
                                    </div>
                                </div>
                            <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">专栏标题:</label>
                                    <div class="col-sm-10">
                                        <input type="text" placeholder="填写标题" class="dunk_ps form-control" name="title">
                                    </div>
                                </div>
                            <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">专栏简介:</label>
                                    <div class="col-sm-10">
                                        <input type="text" placeholder="填写专栏简介" class="dunk_ps form-control" name="intro">
                                    </div>
                                </div>
                            <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">专栏内容:</label>
                                    <div class="col-sm-10">
                                        <textarea style="left: 98px;height: 138px;resize: none;overflow: auto;" class="dunk_ps form-control" name="text" id="passport_userdetail">

                                        </textarea>
                                    </div>
                                </div>
                            <div class="modal-footer" style=" border-top:none;text-align:center;">
                                <input style="width:200px;" class="btn btn-info" type="submit" value="确定">
                            </div>
                        </form>
                        </div>
                    </div>
                </div>
            </div>
        </h2>
        <div class="my-order-wrap">
            <table class="table table-hover my-order-list" data-token="b85c364572f96a34c7a2e04eeee935e4">
                <thead>
                <tr class="info" style="text-align:center;">
                    <th>ID</th>
                    <th style="width:200px;" class="order-icon-h">专栏图片</th>
                    <th class="order-num-h">昵称</th>
                    <th class="order-name-h">专栏标题</th>
                    <th class="order-intro-h">专栏简介</th>
                    <th class="order-shoop-h">添加时间</th>
                    <th style="width:200px;" class="order-time-h">专栏内容</th>
                    <th class="" style="width:50px;">操作</th>
                </tr>
                </thead>
                <tbody>
                @if(empty(count($special)))
                    <tr>
                        <td style="background-color:#A2D8F2;line-height:10;height:100px;text-align:center;font-size:20px;" colspan="8">暂无数据</td>
                    </tr>
                @else
                    @foreach($special as $k )
                        <tr>
                            <td>{{$k->id}}</td>
                            <td>
                                @if($k->icon)
                                    <img src="{{asset('/image/special/'.$k->icon)}}">
                                @else
                                    <img src="{{asset('zjx/image/kecheng1.jpg')}}">
                                @endif
                            </td>
                            <td>{{$k->nickname}}</td>
                            <td>{{$k->title}}</td>
                            <td>{{$k->intro}}</td>
                            <td>{{date("Y-m-d",$k->addtime)}}</td>
                            <td >
                                <div style="height:100px;overflow:auto;">{{$k->text}}</div>
                            </td>
                            <td>
                                <a href="{{url('back/center/edit_special/'.$k->id)}}">修改</a>
                                <a href="{{url('back/center/del_special/'.$k->id)}}">删除</a>
                            </td>
                        </tr>
                    @endforeach
                    @endif
                </tbody>
            </table>
            {{$special->links()}}
        @if(count($errors))
                <script>
                        alert('{!!$errors->first('nickname'),$errors->first('title'),$errors->first('text'),$errors->first('intro')!!}');
                    </script>
            @endif
        </div>
    </div>
@endsection